- How does R plot maps?
- What is a straight line, anyway?
- Large spatial datasets with R
- Lifecycle of R Spatial packages
- R Spatial community
UseR! 2021: Jul 5, 2021, 15:30 UTC
⊠any two-dimensional plot of Earth-bound surface data involves projection
plot(map)
maps::map("world")
maps::map("usa")
?map
projection: character string that names a map projection to use. See
âmapprojectâ (in the âmapprojâ library). The default is to
use a rectangular projection with the aspect ratio chosen so
that longitude and latitude scales are equivalent at the
center of the picture.
For simple features, some definitions:
Straight lines, after (re)projection, are no longer straight.
This example is contrived, but relevant for every line except sections of meridians or the equator.
For data with ellipsoidal (long/lat) coordinates, sf 1.0-0 switched to using spherical geometry (\(S^2\)) rather than Cartesian geometry (\(R^2\)). Straight lines are now great circle segments on a sphere.
As the Earthâs shape is closer to a sphere than to a flat plane, this is a good thing, but surprises are going to show up for a while due to doing it wrong for some 50+ years.
To get the “old” (pre-sf 1.0) behaviour, use
sf_use_s2(FALSE),st_set_crs(NA), or+proj=eqc.More discussion on this in the (upcoming) Spatial Data Science book by Roger Bivand and me; also do follow Dewey Dunnington
rgdal and rgeos will retire Jan 1, 2024; sf, terra, stars provide alternativessf now uses spherical geometry: